#ifndef NODE_H_
#define NODE_H_

#include <cmath>

class Node {
private:
	int label;
	double x, y, z;
	double dt, t, p, u1, u2,iu1,iu2;
public:
	Node() {
		x = y = z = 0;
		dt = t = p = u1 = u2 = iu1=iu2=0;
	}
	Node(const Node &node) {
		this->label=node.label;
		this->x = node.x;
		this->y = node.y;
		this->z = node.z;
		this->p = node.p;
		this->t = node.t;
		this->u1 = node.u1;
		this->u2 = node.u2;
		this->iu1 = node.iu1;
		this->iu2 = node.iu2;
		this->dt = node.dt;
	}

	Node & operator=(const Node &node) {
		this->label=node.label;
		this->x = node.x;
		this->y = node.y;
		this->z = node.z;
		this->p = node.p;
		this->t = node.t;
		this->u1 = node.u1;
		this->u2 = node.u2;
		this->iu1 = node.iu1;
		this->iu2 = node.iu2;
		this->dt = node.dt;
		return *this;
	}

	bool operator==(const Node &n){
		if(this->label==n.label)
			return true;
		return false;
	}

	Node(const int label, const double &x, const double &y) {
		this->label = label;
		this->x = x;
		this->y = y;
		this->z=0;
		dt = t = p = u1 = u2 = 0;
	}
	void setLabel(const int &label) {
		this->label = label;
	}
	void setX(const double &x) {
		this->x = x;
	}
	void setY(const double &y) {
		this->y = y;
	}
	void setP(const double &t) {
		this->p = t;
	}
	void setT(const double &t) {
		this->t = t;
	}
	void setU(const double &u1, const double &u2) {
		this->u1 = u1;
		this->u2 = u2;
	}
	
	void setIU(const double &iu1,const double &iu2){
		this->iu1=iu1;
		this->iu2=iu2;
	}
	void setDt(const double &dt) {
		this->dt = dt;
	}

	int & Label() {
		return label;
	}
	double & X() {
		return x;
	}
	double & Y() {
		return y;
	}
	double & Dt() {
		return dt;
	}
	double & P() {
		return p;
	}
	double & T() {
		return t;
	}
	double & U1() {
		return u1;
	}
	double & U2() {
		return u2;
	}
	double & IU1(){
		return iu1;
	}
	double & IU2(){
		return iu2;
	}
	virtual ~Node() {
	}

	double square()
	{
		return (x*x+y*y+z*z);
	}

	double length()
	{
		return sqrt(square());
	}


};

#endif /* NODE_H_ */
